package com.fanix5.javamvvm.adapter;


import static com.fanix5.javamvvm.BR.viewModel;

import android.view.View;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.databinding.DataBindingUtil;
import androidx.databinding.ViewDataBinding;

import com.chad.library.adapter.base.BaseBinderAdapter;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.fanix5.javamvvm.R;
import com.fanix5.javamvvm.bean.DoctorBean;
import com.fanix5.javamvvm.databinding.ItemDoctorListBinding;
import com.fanix5.javamvvm.viewmodel.state.DoctorListViewModelAdapter;

import java.util.ArrayList;
import java.util.List;

public class DoctorListAdapter extends BaseQuickAdapter<DoctorBean, BaseDataBindingHolder<ItemDoctorListBinding>> {


    public DoctorListAdapter() {
        super(R.layout.item_doctor_list);
        this.setAnimationEnable(true);
    }



    @Override
    protected void convert(@NonNull BaseDataBindingHolder<ItemDoctorListBinding> itemDoctorListBindingBaseDataBindingHolder, DoctorBean doctorBean) {
        if (doctorBean == null) {
            return;
        }
        ItemDoctorListBinding binding = itemDoctorListBindingBaseDataBindingHolder.getBinding();

        if (binding != null) {
            binding.setItem(doctorBean);
            binding.executePendingBindings();
        }
    }
}